# ab1.awk
# ordena as aberturas de acordo com o campo centers
#
# Criado por: Paulo Henrique Silva de Santana
# 17/07/2002 20:31

BEGIN {
	RS = ""
}

{
	s = $0
	ind = $19
	fig = index(ind,".")
	# awk is reading the center as a string and then I can't sort
	# the centers numerically as 100.2 < 89.0 for example.
	# so I am adding 0s to the ind string so they all have the same 
	# length and I end up comparing 0100.2 > 0089.0
	if ( fig==4 ) ind = "00" ind
	else if (fig==3) ind = "000" ind
	else if (fig==2) ind = "0000" ind
	blocos[ind] = s
}

END {
	j = 1
	for (center in blocos) {
		centers[j] = center 
		j++
	}

 	n = asort(centers)

	for (i = 1; i <= n; i++) {
		print blocos[centers[i]]
		print ""
	}
	
}
